
#include "mainwindow.h"
#include "mainImg.h"
#include "InitObject.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    Q_INIT_RESOURCE(glsl);

	InitObject::Instance();

    MainImg w;

	#if 0
    // 生成示例点云
    QVector<QVector3D> points;
    QVector<QVector3D> colors;

    for (int i = 0; i < 100000; ++i)
    {
        points.append(QVector3D(
                          (float)rand() / RAND_MAX * 2 - 1,
                          (float)rand() / RAND_MAX * 2 - 1,
                          (float)rand() / RAND_MAX * 2 - 1
                          ));
        colors.append(QVector3D(
                          (float)rand() / RAND_MAX,
                          (float)rand() / RAND_MAX,
                          (float)rand() / RAND_MAX
                          ));
    }

    w.setPointCloud(points, colors);
	#endif

    w.show();

	InitObject::Instance()->connectDepthDataProcess(&w);

	InitObject::Instance()->startInit();

    return a.exec();
}
